#include<bits/stdc++.h>
using namespace std;
#define int long long

int a[1000];

signed main() {
	int n, m, index;
	cin >> n >> m >> index;
	int live = n, number = 0;
	index--;
	while (live != 1) {
		number++;
		if (number == m) {
			number = 0;
			a[index] = 1;
			live--;
//			cout << index + 1 << "!!!" << endl;
		}
		index = (index + 1) % n;
		while (a[index])
			index = (index + 1) % n;
	}
	for (int i = 0; i < n; i++) {
		if (!a[i])	cout << i + 1;
	}
	return 0;
}
